home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
8206
/
8206.xpi
/
content
/
dialogs
/
imFormatDlg.js
< prev
next >
Wrap
Text File
|
2010-02-02
|
2KB
|
52 lines
var ImFormatDlg = function() {
var pub = {};
pub.prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
pub.edit = null;
pub.onLoad = function()
{
var settings = window.arguments[0].settings;
document.getElementById("hidechat").checked = settings.hideTitle;
document.getElementById("chattext").value = settings.title;
var showLabels = settings.showLabels;
var showIcons = settings.showIcons;
if (showLabels && !showIcons)
document.getElementById("imformat").value = "text";
else if (showIcons && !showLabels)
document.getElementById("imformat").value = "icons";
else
document.getElementById("imformat").value = "iconsandtext";
pub.updateUI(settings.hideTitle);
}
pub.onAccept = function()
{
var settings = window.arguments[0].settings;
settings.hideTitle = document.getElementById("hidechat").checked;
settings.title = document.getElementById("chattext").value;
var val = document.getElementById("imformat").value;
settings.showLabels = val == "text" || val == "iconsandtext";
settings.showIcons = val == "icons" || val == "iconsandtext";
window.arguments[0].settings = settings;
window.arguments[0].result = true;
}
pub.updateUI = function(check)
{
// note that the checkbox.checked value is before the change!
var textHidden = check != undefined ? check : !document.getElementById("hidechat").checked;
var textbox = document.getElementById("chattext");
textbox.disabled = textHidden;
}
return pub;
} ();